<template>
  <div>
    <el-avatar icon="el-icon-user-solid" :size="20"></el-avatar>
    <span>{{a}}</span>
    <el-button type="danger" size="mini" @click="logout" :loading="logining">注销</el-button>
  </div>
</template>

<script>
  export default {
    name: "statusBar",
    data() {
      return {
        logining: false,
        a: '张三'
      }
    },
    methods: {
      logout() {
        this.logining = true;
        var url = this.HOME + '/ccwl/api/account/logout';
        this.$axios.get(url).then((response) => {
          this.logining = false;
          this.datalist = response.data;
          // console.log(this.datalist);
          sessionStorage.clear();
          alert("登出成功");
          this.$router.push({ path:'/'});
        })
      }
    }
  }
</script>

<style scoped>
  .el-avatar {
    vertical-align: top;
    margin-top: 2.5px;
  }

  span {
    margin: 0 10px 0 0;
    font-family: KaiTi;
  }
</style>
